<!-- 
    Document   : index - диалоговая страница выбора отчетов
    Created on : 06.10.2008, 17:04:02
    Author     : egorov
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html  xml:lang="ru" lang="ru">
    <head>
        <title>$R{reports} QSystem</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="./js/datepicker.js"></script>
        <!-- <link href="./css/demo.css"       rel="stylesheet" type="text/css" /> -->
        <link href="./css/datepicker.css" rel="stylesheet" type="text/css" />    
        <script type="text/javascript">

            function makeTwoChars(inp) {
                return String(inp).length < 2 ? "0" + inp : inp;
            }

            function initialiseInputs() {
                // Clear any old values from the inputs (that might be cached by the browser after a page reload)
                document.getElementById("sd").value = "";
                document.getElementById("ed").value = "";

                // Add the onchange event handler to the start date input
                datePickerController.addEvent(document.getElementById("sd"), "change", setReservationDates);
            }

            var initAttempts = 0;

            function setReservationDates(e) {
                // Internet Explorer will not have created the datePickers yet so we poll the datePickerController Object using a setTimeout
                // until they become available (a maximum of ten times in case something has gone horribly wrong)

                try {
                    var sd = datePickerController.getDatePicker("sd");
                    var ed = datePickerController.getDatePicker("ed");
                } catch (err) {
                    if (initAttempts++ < 10)
                        setTimeout("setReservationDates()", 50);
                    return;
                }

                // Check the value of the input is a date of the correct format
                var dt = datePickerController.dateFormat(this.value, sd.format.charAt(0) == "m");

                // If the input's value cannot be parsed as a valid date then return
                if (dt == 0)
                    return;

                // At this stage we have a valid YYYYMMDD date

                // Grab the value set within the endDate input and parse it using the dateFormat method
                // N.B: The second parameter to the dateFormat function, if TRUE, tells the function to favour the m-d-y date format
                var edv = datePickerController.dateFormat(document.getElementById("ed").value, ed.format.charAt(0) == "m");

                // Set the low range of the second datePicker to be the date parsed from the first
                ed.setRangeLow(dt);

                // If theres a value already present within the end date input and it's smaller than the start date
                // then clear the end date value
                if (edv < dt) {
                    document.getElementById("ed").value = "";
                }
            }

            function removeInputEvents() {
                // Remove the onchange event handler set within the function initialiseInputs
                datePickerController.removeEvent(document.getElementById("sd"), "change", setReservationDates);
            }

            datePickerController.addEvent(window, 'load', initialiseInputs);
            datePickerController.addEvent(window, 'unload', removeInputEvents);

            //]]>
        </script>
        <style type="text/css">
            body, html
            {
                height:100%;
            }
        </style>    
    </head>
    <body text="#000000" bgcolor="#1177BB" background="resources/fp.png" link="#222277" alink="#333399" vlink="#222288" leftmargin="0" bottommargin="0" topmargin="0">
        <center>



            <table border="0" width="0" cellspacing="0">
                <tbody>
                    <tr>
                        <td><center><a href="http://apertum.ru" target="_blank"><img src="resources/top.jpg" width="800" height="222" alt="{Apertum}Projects - QSystem" border="0" vspace="0"/></a></center></td>
                    </tr>
                    <tr>
                        <td height="85" valign="top"><H2><font color="#555555">
                                    $R{result_state_services} #PROJECT_NAME_ANCHOR# #ERROR_INPUT_DATA#
                                    <Hr>
                                </font></H2></td>
                    </tr>    

                    <tr><td><center>
                                <form action="#DATA_FOR_REPORT#" name="form1" method="GET" >   
                                    <h3>$R{result_state_services}:</h3>
                                    <p><fieldset>
                                        <label for="sd">$R{start_date} : </label> <br>
                                        <input type="text" class="w8em divider-dot format-d-m-y highlight-days-67" name="sd" id="sd" value="" maxlength="10" /> <br>
                                        <label for="ed">$R{finish_date} : </label>   <br>
                                        <input type="text" class="w8em divider-dot format-d-m-y highlight-days-67" name="ed" id="ed" value="" maxlength="10" />
                                    </fieldset></p>
                                    <p><input type="submit" value="$R{send}"><input type="reset" value="$R{clear}"></p>   
                                </form>    
                            </center></td></tr>

                    <tr>
                        <td height="100" valign="bottom"><center><H6><font color="#000000">
                                        <Hr> 
                                        © Apertum Projects<br />
                                        e-mail: <a href="mailto:info@apertum.ru">info@apertum.ru</a><br/>
                                        $R{promo_bottom}
                                    </font></H6></center></td>
                    </tr> 
                </tbody>
            </table>
        </center>
    </body>

</html>
